package com.igeek.boot.controller;


import com.igeek.boot.entity.Suppliers;
import com.igeek.boot.result.Result;
import com.igeek.boot.service.ISuppliersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jwj
 * @since 2023-12-26
 */
@RestController
@RequestMapping("/wisdom_factory/suppliers")
@Api(tags = "供应商接口")
public class SuppliersController {

    @Autowired
    private ISuppliersService suppliersService;

    //查询所有的供应商信息
    @ApiOperation(value = "查询所有的供应商信息")
    @GetMapping("/findAll")
    public Result findAll(){
        List<Suppliers> list = suppliersService.list();
        if(!CollectionUtils.isEmpty(list)){
            return new Result(true, "查询成功", list);
        }
        return new Result(false, "查询失败");
    }

}
